package own.stu.jobgib.playown.fsm.hfsm.states;

import lombok.extern.slf4j.Slf4j;
import own.stu.jobgib.playown.fsm.hfsm.StateBase;
import own.stu.jobgib.playown.fsm.hfsm.StateEnum;

@Slf4j
public class StateReset extends StateBase {

    private boolean isHunger;

    private boolean toPlay;

    private boolean toWrite;

    public StateReset() {
        super(StateEnum.RESET);
    }

    public void onEnter() {
        log.info("我要开始休息了");
    }

    public void onExecute() {
        // 如果饿了，转换到吃饭状态
        if (isHunger) {
            transitionEvent(StateEnum.EAT);
        } else if (toPlay) // 如果想打球了，切换到打球状态
        {
            transitionEvent(StateEnum.BASKETBALL);
        } else if (toWrite) // 如果该写作业了，切换到写作业状态
        {
            transitionEvent(StateEnum.HOMEWORK);
        } else {
            log.info("休息中");
        }
    }

    public void onExit() {
        log.info("美美的睡了一觉，好精神");
        log.info("叠被子");
        log.info("收拾房间");
    }
}
